package com.qfmy.webapp.controller.common;

import com.qfmy.common.result.Result;
import com.qfmy.model.vo.common.AnnouncementVo;
import com.qfmy.webapp.service.common.AnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.controller.common
 * @date 2025/11/26
 * @description 创建公高
 */
@RestController
@SuppressWarnings("all")
@RequestMapping("/app/announcement")
public class AnnouncementController {

    /**
     * 注入公告服务
     */
    @Autowired
    private AnnouncementService announcementService;

    /**
     * 根据公告的类型获取对应的公獒
     */
    @RequestMapping("/getAnnouncementByType")
    public Result<List<AnnouncementVo>> getAnnouncementByType(@RequestParam Integer type) {
        List<AnnouncementVo> list =  announcementService.getAnnouncementByType(type);
        return Result.ok(list);
    }

}
